<template>
	<view class="container" :style="$theme.pageStyle">

		<view style="height: 20px;">

		</view>

		<cl-cell-group title="基础设置">

			<cl-cell title="个人信息" value="去设置" url="/pages/center/seting/person" icon="person"></cl-cell>

			<cl-cell title="隐私协议" url="/pages/content/index?name=privacy" icon="eye-slash"></cl-cell>

			<cl-cell title="服务协议" url="/pages/content/index?name=service" icon="hand-up"></cl-cell>

			<cl-cell title="关于我们" url="/pages/content/index?name=about" icon="info" :border="false"></cl-cell>

		</cl-cell-group>


		<button class="Button1 flex-col" @click="bindLogout()">
			<text class="word4">退出登录</text>
		</button>

	</view>
</template>

<script>
	import $H from '@/common/js/request.js';
	import store from '@/store'
	export default {
		components: {
			// uniIcons
		},
		data() {
			return {
				referees: '',
				version: '1.0.0',
				wechatype: '',
				type: 1,
				xxx: '0B',
				servicer: 1,
				bindwwxapp: 0
			};
		},

		onShow() {

		},


		methods: {

			cache() {

			},

			handleCheck(res) {
				this.release = res;
			},
			handleFinish(res) {
				if (!res.isTest) {
					uni.showToast({
						title: '已经是最新版',
						icon: 'none'
					})
				}
			},
			// 断掉流量和WIFI试试
			handleError(err) {
				console.error(err)
			},

			versions(type) {
				if (type == 1) {
					var text = '当前已经是最新版本'
				} else {
					var text = "新版本已更新，请去官网下载更新！";
				}
				uni.showModal({
					title: '',
					content: text,
					contentColor: '#000000',
					confirmText: '确认',
					confirmColor: '#6e8cfa',
					cancelColor: '#D2D2D2',
					showCancel: false,
					success: function(res) {

					}
				});
			},

			jumpurl(url) {
				uni.setStorageSync('add', 0);
				if (url == '') {
					uni.showModal({
						title: '温馨提示',
						content: '此功能正在开发中，敬请期待！',
						confirmText: '确认',
						confirmColor: '#FFAE00',
						cancelColor: '#D2D2D2',
						showCancel: false,
						success: function(res) {

						}
					});
				} else {
					uni.navigateTo({
						url: url
					});
				}

			},

			bindLogout: function() {

				uni.removeStorageSync('token', '');
				uni.removeStorageSync('userInfo', '');
				uni.removeStorageSync('userId', '');
				uni.removeStorageSync('userId_expiry', '');
				uni.removeStorageSync('token_expiry', '');
				//登录验证

				store.dispatch('Logout', {})
					.then(result => {
						
						uni.showToast({
							icon: 'none',
							title: '退出成功'
						})
						
						uni.redirectTo({
							url: '/pages/login/index'
						})
						
					})
					.catch(err => {
						
					})
					
			}
		}
	}
</script>

<style>
	page {
		background: #f8f8f8;
	}

	.box {
		border-radius: 10px;
	}

	.list {
		display: flex;
		flex-wrap: wrap;
		flex-direction: row;
		display: inline-flex;
		width: 100%;
		height: 100upx;
		font-size: 30upx;
		padding: 0 10upx;
		text-indent: 30upx;
		line-height: 100upx;
		background-color: #fff;
		border-bottom: 3upx solid #F1F1F1;
	}

	.li-left {
		width: 40%;
	}

	.li-center {
		text-align: right;
		width: calc(60% - 80upx);
	}

	.li-right {
		width: 80upx;
		align-self: center;
	}

	.btn-area {
		margin: 100upx 40upx;
	}

	.icon {
		padding-right: 20upx;
		float: right;
		color: #D6D6D6;
		line-height: 100upx;
	}

	.btn-submit {
		width: 100%;
		height: 100upx;
		color: #FFFFFF;
		line-height: 100upx;
		margin: 30upx 0;
		background: #FFB702;
		border-radius: 10upx;
	}

	.zhanwei {
		height: 10px;
	}

	.Button1 {
		/* box-shadow: 0px 10px 21px 5px rgba(9, 134, 227, 0.28); */
		background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light-3) 100%);
		border-radius: 10px;
		height: 50px;
		margin: 15px;
		margin-top: 50px;
	}

	.word4 {
		width: 100%;
		height: 50px;
		overflow-wrap: break-word;
		color: rgba(255, 255, 255, 1);
		font-size: 16px;
		text-align: center;
		white-space: nowrap;
		line-height: 50px;
		display: block;
	}
</style>